<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <title>日志列表</title>
    <base href="<%=basePath %>"/>
    <%--<meta charset="utf-8">--%>
    <%--<meta name="renderer" content="webkit|ie-comp|ie-stand">--%>
    <%--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">--%>
    <%--<meta name="viewport"--%>
          <%--content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>--%>
    <%--<meta http-equiv="Cache-Control" content="no-siteapp"/>--%>
    <%--<link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui/css/H-ui.min.css"/>--%>
    <%--<link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui.admin/css/H-ui.admin.css"/>--%>
    <%--<link rel="stylesheet" type="text/css" href="assets/H-ui/lib/Hui-iconfont/1.0.8/iconfont.css"/>--%>
    <%--<link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui.admin/skin/default/skin.css" id="skin"/>--%>
    <%--<link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui.admin/css/style.css"/>--%>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.css"/>
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>

</head>
<body>
<%--<div class="Hui-article">--%>
    <form id="itemForm">
        <%--<article class="cl pd-20">--%>
            <%--<div class="text-c">--%>
            <div class="container">
                <div class="col-lg-10 col-lg-offset-1">
                    <div class="panel-body">
                <input type="text" name="userName" id="userName" placeholder="账号" style="width:250px"
                       class="input-text" value="${param.userName}">
                <input type="hidden" name="pageSize" value="10">
                <input type="hidden" name="pageNum" value="1">
                <button name="check" id="" class="btn-sm btn-primary" type="submit"><%--<i class="Hui-iconfont">&#xe665;</i>--%> 搜索
                </button>
            </div>
            <div class="mt-20">
                <table id="logTable" class="table table-hover table-bordered<%--table table-border table-bordered table-hover table-bg table-sort--%>">
                    <thead>
                    <tr class="text-c">
                        <th width="80" style="text-align: center">账号</th>
                        <th width="100" style="text-align: center">操作类型</th>
                        <th width="100" style="text-align: center">操作事项</th>
                        <th width="100" style="text-align: center">操作时间</th>
                    </tr>
                    </thead>
                    <tbody id="logTbody" style="text-align: center">
                    <tr class="text-c">

                    </tr>
                    <c:forEach items="${logs.list}" var="log">
                        <tr>
                        <td>${log.userName}</td>
                        <td>${log.operType}</td>
                        <td>${log.logdetail}</td>
                        <%--<td>${log.operTime}</td>--%>
                        <td><fmt:formatDate value="${log.operTime }" type="date" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                        </tr>
                    </c:forEach>
                    <%--<tr>--%>
                        <%--<td>共${logs.pages}页，当前第${logs.pageNum}页</td>--%>
                        <%--<td></td><td></td>--%>
                        <%--<td>--%>
                            <%--<a onclick="pre_page(${logs.prePage})">上一页</a>--%>
                            <%--<a onclick="pre_page(${logs.nextPage})">下一页</a>--%>
                        <%--</td>--%>
                    <%--</tr>--%>
                    </tbody>

                </table>
                <div id="page" style="float: right" align="center">
                    当前第${logs.pageNum}页, 总共${logs.pages}页，每页${logs.pageSize}行，总共${logs.total}行。
                    <a id="firstPage" class="btn-sm btn-primary" onclick="pre_page(${logs.prePage})">上一页</a>
                    <a id="lastPage" class="btn-sm btn-primary" onclick="pre_page(${logs.nextPage})">下一页</a>
                </div>
            </div>
        <%--</article>--%>
                </div>
            </div>
    </form>


</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="assets/H-ui/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="assets/H-ui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="assets/H-ui/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="assets/H-ui/static/h-ui.admin/js/H-ui.admin.page.js"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="assets/H-ui/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="assets/H-ui/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="assets/H-ui/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    /*
        参数解释：
        title	标题
        url		请求的url
        id		需要操作的数据id
        w		弹出层宽度（缺省调默认值）
        h		弹出层高度（缺省调默认值）
    */

    /*$('.table-sort').dataTable({
        //"aaSorting": [[ 1, "desc" ]],//默认第几个排序
        "bStateSave": true,//状态保存
        "autoWidth": true,//自适应宽度
        "aoColumnDefs": [
            //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
            {"orderable":false,"aTargets":[0,8]}// 制定列不参与排序
        ]
    });

    /!*系统-栏目-编辑*!/
    function system_category_edit(title,url,id,w,h){
        layer_show(title,url,w,h);
    }
    /!*系统-栏目-删除*!/
    function system_category_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }*/

    function add_item() {
        $.post(
            "/item/addItem.action",
            $("#addItemFrom").serialize(),
            function (msg) {
            if(msg="success"){
                alert("添加成功！");
                location.href="/page/itemlist.action";
            }else{
                alert("添加失败！");
            }
        });


    }

    function pre_page(num) {
        if(num>0){
            var form=$("form");
            $("input[name='pageNum']").val(num);
            form.method="post";
            form.submit();
        }
    }

    function show_add_item() {
        $.post("/desk/getDesk.action", function (desks) {
            $('#deskId').html(null);
            $("#deskId").append("<option value=''>请选择</option>");
            desks.forEach(function (desk) {
                $("#deskId").append(
                    "<option value='" + desk.deskId + "'>" + desk.deskName + "</option>"
                );
            });
        });
    }

   /* function article_edit(title, url, id) {
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }*/

    function article_edit(id){
        location.href="/detail/findItemdetails.action?itemId="+id;
    }


</script>
</body>
</html>